﻿

    <div ms-controller="tempview"  class="sui-form form-horizontal">
        <div class="sui-form form-inline">
            通道数据量：{{DBCount}}
           

            <a class="sui-btn btn-large btn-primary" style="margin-left:10px;" ms-click="GetDBCount()">刷新</a>
        </div>
        <div class="sui-form form-inline">
           备份数据时间点：
            <input type="text" data-toggle="datepicker" class="input-medium input-xfat" ms-duplex="search.BKTime">
          
            <a class="sui-btn btn-large btn-primary" style="margin-left:10px;" ms-click="BackData()">备份</a>
        </div>
        

    <table class="sui-table table-primary table-zebra">
  <thead>
    <tr>
      <th>备份数据时间点</th>
      <th>备份数据</th>
      <th>操作人</th>
        <th>操作时间</th>
    </tr>
  </thead>
  <tbody>
    <tr ms-repeat-el="ListData">
      <td>{{el.BKTime|date('yyyy-MM-dd')}}</td>
      <td>{{el.BKCount}}</td>
      <td>{{el.UserName}}</td>
        <td>{{el.CRTime}}</td>
    </tr>

  </tbody>
</table>

    <div id="pageDiv"></div>

    </div>

  <script type="text/javascript">
      var tempmodel = avalon.define({
          $id: "tempview",
          search: {key:"",BKTime:""},
          page: { pageindex: 1, pagecount: 10 },
          ShowColumns: [],
          ListData: [],
          APINAME: "",
          Operation: "",
          DBCount:"",
          GetLIST: function () {
              
              ComFunJS.getJSON("BASE_GETLOG", { pageindex: tempmodel.page.pageindex, P1:"bk" }, function (r) {
                  if (r.error == "") {
                      tempmodel.ListData = r.result;

                      $("#pageDiv").pagination({  //分页容器
                          styleClass: ['sui-pagination'],  //分页样式
                          //showCtrl: false,
                          displayPage: 6,
                          itemsCount: r.total,
                          pageSize: tempmodel.page.pagecount,
                          onSelect: function (num) {
                              tempmodel.page.pageindex = num;
                              ComFunJS.getJSON("BASE_GETLOG", { pageindex: tempmodel.page.pageindex, P1: "bk" }, function (r) {
                                  tempmodel.ListData.clear();
                                  tempmodel.ListData = r.result;
                              })
                          }
                      })

                      $('#pageDiv').pagination('updateItemsCount', r.total, 1);
                  }
              })
          },
          GetDBCount: function () {
              ComFunJS.getJSON("BASE_GETDATACOUNT", function (r) {
                  if (r.error == "") {
                      tempmodel.DBCount = r.result;
                  }
              });
          },
          BackData: function () {

              if (tempmodel.search.BKTime) {
                  ComFunJS.getJSON("BASE_BKDATA", { P1: tempmodel.search.BKTime }, function (r) {
                      if (r.error == "") {
                          tempmodel.GetLIST();
                          top.ComFunJS.winShowMsg("操作成功");
                      }
                  })
              }
          }
      })
      avalon.ready(function () {
          tempmodel.GetDBCount();
          tempmodel.GetLIST();
         
      })

      
  </script>
